import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";

function pathResolve(dir) {
    return resolve(process.cwd(), ".", dir);
}

export default ({ mode }) =>
    defineConfig({
        // 路径重定向
        resolve: {
            alias: [
                {
                    find: "@",
                    replacement: pathResolve("src"),
                },
                {
                    find: "#",
                    replacement: pathResolve("public"),
                },
            ],
            dedupe: ["vue"],
        },
        // 开发服务器
        server: {
            host: true,
            open: true,
            port: 5173,
        },
        plugins: [vue()],
    });


